using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bxas.Core;
using System.Xml.Serialization;
using PhotoHsn.BLL.Abstracts;
using PhotoHsn.BLL.Adapters;
using PhotoHsn.BLL.Core;

namespace PhotoHsn.BLL.Adapters
{
    [XmlType(Namespace = "urn:DataObjects")]
    [XmlRoot(Namespace = "urn:DataObjects")]
    [Serializable]
    public class PhotoComments : ColumnInfo
    {
        public PhotoComments()
        {
            this.priymatyKeyColumnName = "Id";
            this.priymatyKeyColumnType = typeof(System.Guid);
            this.TableName = "PhotoComments";
        }

        #region Fields
		private Guid id = System.Guid.Empty;
		private Guid photoId = System.Guid.Empty;
		private Guid memberId = System.Guid.Empty;
		private string comments = string.Empty;
		private byte creativityPoints = 0;
		private byte compositionPoints = 0;
		private byte aestheticPoints = 0;
		private byte technicalPoints = 0;
		private DateTime createDate = new DateTime();
		private DateTime updateDate = new DateTime();
		private bool isActive = false;
		private bool isDeleted = false;
		private bool isBadContent = false;

        #endregion
        
        #region Properties
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		[ColumnAttributes("Id",true,"Guid")]
		public Guid Id
		{
			 get 
			 {
			    return id;
			 }
			 set 
			 { 
			    if (value != id)
			    { 
			      id = value; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.Id))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.Id, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		[ColumnAttributes("PhotoId",true,"Guid")]
		public Guid PhotoId
		{
			 get 
			 {
			    return photoId;
			 }
			 set 
			 { 
			    if (value != photoId)
			    { 
			      photoId = value; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.PhotoId))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.PhotoId, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = uniqueidentifier
		///C# Type = Guid
		///</summary> 
		[ColumnAttributes("MemberId",true,"Guid")]
		public Guid MemberId
		{
			 get 
			 {
			    return memberId;
			 }
			 set 
			 { 
			    if (value != memberId)
			    { 
			      memberId = value; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.MemberId))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.MemberId, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = nvarchar
		///C# Type = string
		///</summary> 
		[ColumnAttributes("Comments",true,"string")]
		public string Comments
		{
			 get 
			 {
			    return comments;
			 }
			 set 
			 { 
			    string valueTrimmed = value.Trim(); 

			    if (valueTrimmed != comments)
			    { 
			      comments = valueTrimmed; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.Comments))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.Comments, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = tinyint
		///C# Type = byte
		///</summary> 
		[ColumnAttributes("CreativityPoints",false,"byte")]
		public byte CreativityPoints
		{
			 get 
			 {
			    return creativityPoints;
			 }
			 set 
			 { 
			    if (value != creativityPoints)
			    { 
			      creativityPoints = value; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.CreativityPoints))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.CreativityPoints, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = tinyint
		///C# Type = byte
		///</summary> 
		[ColumnAttributes("CompositionPoints",false,"byte")]
		public byte CompositionPoints
		{
			 get 
			 {
			    return compositionPoints;
			 }
			 set 
			 { 
			    if (value != compositionPoints)
			    { 
			      compositionPoints = value; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.CompositionPoints))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.CompositionPoints, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = tinyint
		///C# Type = byte
		///</summary> 
		[ColumnAttributes("AestheticPoints",false,"byte")]
		public byte AestheticPoints
		{
			 get 
			 {
			    return aestheticPoints;
			 }
			 set 
			 { 
			    if (value != aestheticPoints)
			    { 
			      aestheticPoints = value; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.AestheticPoints))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.AestheticPoints, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = tinyint
		///C# Type = byte
		///</summary> 
		[ColumnAttributes("TechnicalPoints",false,"byte")]
		public byte TechnicalPoints
		{
			 get 
			 {
			    return technicalPoints;
			 }
			 set 
			 { 
			    if (value != technicalPoints)
			    { 
			      technicalPoints = value; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.TechnicalPoints))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.TechnicalPoints, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = datetime
		///C# Type = DateTime
		///</summary> 
		[ColumnAttributes("CreateDate",true,"DateTime")]
		public DateTime CreateDate
		{
			 get 
			 {
			    return createDate;
			 }
			 set 
			 { 
			    if (value != createDate)
			    { 
			      createDate = value; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.CreateDate))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.CreateDate, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = datetime
		///C# Type = DateTime
		///</summary> 
		[ColumnAttributes("UpdateDate",true,"DateTime")]
		public DateTime UpdateDate
		{
			 get 
			 {
			    return updateDate;
			 }
			 set 
			 { 
			    if (value != updateDate)
			    { 
			      updateDate = value; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.UpdateDate))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.UpdateDate, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bit
		///C# Type = bool
		///</summary> 
		[ColumnAttributes("IsActive",true,"bool")]
		public bool IsActive
		{
			 get 
			 {
			    return isActive;
			 }
			 set 
			 { 
			    if (value != isActive)
			    { 
			      isActive = value; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.IsActive))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.IsActive, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bit
		///C# Type = bool
		///</summary> 
		[ColumnAttributes("IsDeleted",true,"bool")]
		public bool IsDeleted
		{
			 get 
			 {
			    return isDeleted;
			 }
			 set 
			 { 
			    if (value != isDeleted)
			    { 
			      isDeleted = value; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.IsDeleted))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.IsDeleted, true); 
			      this.IsDirty = true; 
			    }
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bit
		///C# Type = bool
		///</summary> 
		[ColumnAttributes("IsBadContent",true,"bool")]
		public bool IsBadContent
		{
			 get 
			 {
			    return isBadContent;
			 }
			 set 
			 { 
			    if (value != isBadContent)
			    { 
			      isBadContent = value; 
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.IsBadContent))
			      IsUpdateOrInsert.Add(PhotoComments.ColumnNames.IsBadContent, true); 
			      this.IsDirty = true; 
			    }
			 }
		}

        #endregion
		        
        #region StringProperties
 
		///<summary>
		///Required = true
		///DBType = Guid
		///C# Type = Guid
		///</summary> 
		public virtual string s_Id
		{
			 get 
			 {
			        return Getuniqueidentifier_s(id);
			 }
			 set 
			 { 
			        Setuniqueidentifier_s(value, ref id);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.Id))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.Id, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = Guid
		///C# Type = Guid
		///</summary> 
		public virtual string s_PhotoId
		{
			 get 
			 {
			        return Getuniqueidentifier_s(photoId);
			 }
			 set 
			 { 
			        Setuniqueidentifier_s(value, ref photoId);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.PhotoId))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.PhotoId, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = Guid
		///C# Type = Guid
		///</summary> 
		public virtual string s_MemberId
		{
			 get 
			 {
			        return Getuniqueidentifier_s(memberId);
			 }
			 set 
			 { 
			        Setuniqueidentifier_s(value, ref memberId);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.MemberId))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.MemberId, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = string
		///C# Type = string
		///</summary> 
		public virtual string s_Comments
		{
			 get 
			 {
			        return Getnvarchar_s(comments);
			 }
			 set 
			 { 
			        Setnvarchar_s(value, ref comments);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.Comments))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.Comments, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = byte
		///C# Type = byte
		///</summary> 
		public virtual string s_CreativityPoints
		{
			 get 
			 {
			        return Gettinyint_s(creativityPoints);
			 }
			 set 
			 { 
			        Settinyint_s(value, ref creativityPoints);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.CreativityPoints))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.CreativityPoints, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = byte
		///C# Type = byte
		///</summary> 
		public virtual string s_CompositionPoints
		{
			 get 
			 {
			        return Gettinyint_s(compositionPoints);
			 }
			 set 
			 { 
			        Settinyint_s(value, ref compositionPoints);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.CompositionPoints))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.CompositionPoints, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = byte
		///C# Type = byte
		///</summary> 
		public virtual string s_AestheticPoints
		{
			 get 
			 {
			        return Gettinyint_s(aestheticPoints);
			 }
			 set 
			 { 
			        Settinyint_s(value, ref aestheticPoints);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.AestheticPoints))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.AestheticPoints, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = false
		///DBType = byte
		///C# Type = byte
		///</summary> 
		public virtual string s_TechnicalPoints
		{
			 get 
			 {
			        return Gettinyint_s(technicalPoints);
			 }
			 set 
			 { 
			        Settinyint_s(value, ref technicalPoints);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.TechnicalPoints))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.TechnicalPoints, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = DateTime
		///C# Type = DateTime
		///</summary> 
		public virtual string s_CreateDate
		{
			 get 
			 {
			        return Getdatetime_s(createDate);
			 }
			 set 
			 { 
			        Setdatetime_s(value, ref createDate);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.CreateDate))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.CreateDate, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = DateTime
		///C# Type = DateTime
		///</summary> 
		public virtual string s_UpdateDate
		{
			 get 
			 {
			        return Getdatetime_s(updateDate);
			 }
			 set 
			 { 
			        Setdatetime_s(value, ref updateDate);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.UpdateDate))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.UpdateDate, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bool
		///C# Type = bool
		///</summary> 
		public virtual string s_IsActive
		{
			 get 
			 {
			        return Getbit_s(isActive);
			 }
			 set 
			 { 
			        Setbit_s(value, ref isActive);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.IsActive))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.IsActive, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bool
		///C# Type = bool
		///</summary> 
		public virtual string s_IsDeleted
		{
			 get 
			 {
			        return Getbit_s(isDeleted);
			 }
			 set 
			 { 
			        Setbit_s(value, ref isDeleted);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.IsDeleted))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.IsDeleted, true);
			        this.IsDirty = true;
			 }
		}
 
		///<summary>
		///Required = true
		///DBType = bool
		///C# Type = bool
		///</summary> 
		public virtual string s_IsBadContent
		{
			 get 
			 {
			        return Getbit_s(isBadContent);
			 }
			 set 
			 { 
			        Setbit_s(value, ref isBadContent);
			      if (!IsUpdateOrInsert.ContainsKey(PhotoComments.ColumnNames.IsBadContent))
			        IsUpdateOrInsert.Add(PhotoComments.ColumnNames.IsBadContent, true);
			        this.IsDirty = true;
			 }
		}

        #endregion

		#region ColumnNames
        public class ColumnNames
        {
		public const string Id = "Id";
		public const string PhotoId = "PhotoId";
		public const string MemberId = "MemberId";
		public const string Comments = "Comments";
		public const string CreativityPoints = "CreativityPoints";
		public const string CompositionPoints = "CompositionPoints";
		public const string AestheticPoints = "AestheticPoints";
		public const string TechnicalPoints = "TechnicalPoints";
		public const string CreateDate = "CreateDate";
		public const string UpdateDate = "UpdateDate";
		public const string IsActive = "IsActive";
		public const string IsDeleted = "IsDeleted";
		public const string IsBadContent = "IsBadContent";

        }
        #endregion
    }
}

namespace PhotoHsn.BLL.Abstracts
{
    public class _PhotoCommentsBs : BaseBs
    {
		public Boolean insert(PhotoComments p) { return this._insert<PhotoComments>(p); }
        public Boolean update(PhotoComments p) { return this._update<PhotoComments>(p); }
        public Boolean delete(PhotoComments p) { return this._delete<PhotoComments>(p); }
        public List<PhotoComments> get(string sql) { return this._get<PhotoComments>(sql); }
        public List<PhotoComments> get(System.Data.SqlClient.SqlCommand sqlcommand) { return this._get<PhotoComments>(sqlcommand); }
		public List<PhotoComments> get_all(List<string> columnNames) { return this._get_all<PhotoComments>(columnNames); }
        public List<PhotoComments> get_all_with_all_columns() { return this._get_all_with_all_columns<PhotoComments>(); }
		public PhotoComments get_by_primarykey(System.Guid pk, List<string> columnNames) { return this._get_by_primarykey<PhotoComments>(pk, columnNames); }
    }
}
